<!--
/**************************************************
* @ payreceivealert.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/12, Simonyi Peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<html>
<head>
<title>应收/应付查询</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
ArrayList deptList = new ArrayList();
ArrayList addrList = new ArrayList();

ArrayList ary = (ArrayList)request.getAttribute("organdaddr");
deptList = (ArrayList)ary.get(0);
addrList = (ArrayList)ary.get(1);


ResultProcess tAlertList = (ResultProcess)session.getAttribute("alertlist");
GSPayReceiveAlertQueryVO oaqVO = (GSPayReceiveAlertQueryVO)session.getAttribute("QUERYCONDITION");
%>
<script>
	var counter;
	<%
		//在此作出成功提示
		if(request.getAttribute("SUCCESSMSG") != null)
			out.print("alert('"+request.getAttribute("SUCCESSMSG")+"');");
	%>
	
	
	var deptlist = new Array();
	//初始化
	<%for(int i=0;i<deptList.size();i++){%>
		deptlist[<%=i%>] = '<%=deptList.get(i)%>';
	<%}%>	

	function process(val){

		if(checkQueryCond){
			if(val == 'Q'){
				payreceivequeryform.action = "<%=response.encodeURL(root+"/A180402.do")%>";
	    		payreceivequeryform.submit();			
	    		return false;
			}
		}
		
	}
	
	function cls(){
		document.all.deptid.options[0].selected=true;
		document.all.provname.value="";
		document.all.workcorpcategory.options[0].selected=true;
		document.all.paytype.options[0].selected=true;
		document.all.alertdate.value="";
		document.all.paystatus.options[0].selected=true;
	}	
	
	function checkQueryCond(){
		if(!isNum(alertdate)){
			alert("请确认输入的提前天数为数字");	return false;
		}
		return ture;
	}
	
</script>
</head>
<body BGCOLOR="#f5f5f5"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">应收/应付查询</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>


<form name="payreceivequeryform" method="post" >
<input type='hidden' name='actionvalue' value=''>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>公司名称</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid">
							<option value=''>--全部--</option>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' <%if(tmp[0].equals(oaqVO==null?"":(oaqVO.deptid==null?"":oaqVO.deptid))) out.print("selected");%>><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>					
					<TD class="bg_column" align=center>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="provname" maxlength="20" value="<%=oaqVO==null?"":(oaqVO.provname==null?"":oaqVO.provname)%>">
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_column" align=center>结算对象类型</TD>
					<TD align=left class="bg_row_odd">
						<select name="workcorpcategory">
							<option value='0'>--全部--</option>
							<option value='1' <%if(oaqVO!=null && "1".equals(oaqVO.workcorpcategory)) out.print("selected");%>>订货单位</option>
							<option value='2' <%if(oaqVO!=null && "2".equals(oaqVO.workcorpcategory)) out.print("selected");%>>供应商</option>
						</select>
					</TD>					
					<TD class="bg_column" align=center>收付款类型</TD>
					<TD align=left class="bg_row_odd">
						<select name="paytype">
							<option value='0'>--全部--</option>
							<option value='1' <%if(oaqVO!=null && "1".equals(oaqVO.paytype)) out.print("selected");%>>收款</option>
							<option value='2' <%if(oaqVO!=null && "2".equals(oaqVO.paytype)) out.print("selected");%>>付款</option>
						</select>
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_column" align=center>提醒日期</TD>
					<TD align=left class="bg_row_odd" >
						提前<input type="text" size='3' name="alertdate" maxlength="20" value="<%=oaqVO==null?"":(oaqVO.alertdate==null?"":oaqVO.alertdate)%>">天
					</TD>			
					<TD class="bg_column" align=center>收付款状态</TD>
					<TD align=left class="bg_row_odd">
						<select name="paystatus">
							<option value='0'>--全部--</option>
							<option value='1' <%if(oaqVO!=null && "1".equals(oaqVO.paystatus)) out.print("selected");%>>未完成</option>
							<option value='2' <%if(oaqVO!=null && "1".equals(oaqVO.paystatus)) out.print("selected");%>>部分完成</option>
							<option value='3' <%if(oaqVO!=null && "2".equals(oaqVO.paystatus)) out.print("selected");%>>全部完成</option>
						</select>
					</TD>					
				</TR>
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
		<input type="button" width="58" class="kuang" height="24" value="查询" onclick="process('Q')"/>&nbsp;
		<input type="button" width="58" class="kuang" height="24" value="清空" onclick="cls()"/>
    </p>

<script language='javascript'>
<%if(request.getAttribute("list") != null){%>
	//var url="<%=response.encodeURL(root+"/A180403.do")%>?req=true";
	window.open("<%=response.encodeURL(root+"/A180403.do")%>?req=true",null,"center=Yes, help=No, resizable=Yes, status=No, width=800px, height=600px, scrollbars=yes");		
<%}%>
</script>
</body>
</html>